package com.example.score.service;

import com.example.score.entity.Teaclass;
import com.example.score.mapper.TeaclassMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ClassService {
    @Resource
    private TeaclassMapper classMapper;
    public Integer create(Teaclass teaclass) {
        classMapper.create(teaclass);
//        System.out.println(77777);
//        System.out.println(teaclass.getId());
        return teaclass.getId();
    }
    public List<Teaclass> getListById(Integer userId) {
        return classMapper.getListById(userId);
    }
    public List<Teaclass> getMembersByCourseId(Integer courseId) {
        return classMapper.getMembersByCourseId(courseId);
    }
    public String getClassNameByID(Integer classId) {
        return classMapper.getClassNameByID(classId);
    }

    public int joinCourse(Integer classId, Integer courseId,Integer userId) {
        System.out.println(888);
        System.out.println(classId);
        return classMapper.joinCourse(classId, courseId, userId);
    }

//    public List<Teaclass> showAllClassList(){ return classMapper.showAllClassList();}
}
